<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //for 循环可以执行相同的代码
        var num = prompt("今晚准备玩几把游戏");
        for (var i = 0 ; i < num ; i++) {
            console.log("金晚吃鸡");
        }
        for (var i = 0 ; i < 10 ; i++){
            //获取i 每次的值
            console.log(i);
            console.log("张三今年"+i+"岁");
            if (i < 12 && i > 6) {
                console.log("今年张三上小学");
            }
            if (i > 12 && i < 18) {
                console.log("今年张三上中学");
            }
            if (i > 18 && i < 24) {
                console.log("今年张三上大学");
            }
        }
    </script>
</head>
<body>
    
</body>
</html>